package by.pavlyukevich.paymentsystem.datamodel.erip;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

import by.pavlyukevich.paymentsystem.datamodel.AbstractEntity;
import by.pavlyukevich.paymentsystem.datamodel.payment.PaymentType;

@Entity
public class PaymentTree extends AbstractEntity<Integer> {

	@Column
	private Integer parent;

	@Column
	private String name;

	@OneToMany(mappedBy = "paymentTree", cascade = { CascadeType.ALL }, orphanRemoval = true)
	private Set<PaymentType> paymentTypes;

	public Set<PaymentType> getPaymentTypes() {
		return paymentTypes;
	}

	public void setPaymentTypes(Set<PaymentType> paymentTypes) {
		this.paymentTypes = paymentTypes;
	}

	public Integer getParent() {
		return parent;
	}

	public void setParent(Integer parent) {
		this.parent = parent;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
